<?php

# 格式化打印输出
function dd()
{
    echo "<pre>";
    $vars = func_get_args();
    if (!empty($vars)) {
        foreach ($vars as $var) {
            var_dump($var);
        }
    }
    echo "</pre>";
    die;
}


function array_flatten($array)
{
    $return = [];

    array_walk_recursive($array, function ($x) use (&$return) {
        $return[] = $x;
    });

    return $return;
}
